package export.monster
{
	import base.BaseMonster;
	
	import com.dusk.util.FilterUtil;
	
	import com.game.manager.AnimationManager;
	
	import export.bullet.EnemyMoveBullet;
	
	import export.bullet.RegionBullet;
	
	import flash.geom.Rectangle;
	//飞刀小怪
	public class Monster203 extends BaseMonster
	{
		public function Monster203()
		{
			super();
		}
		
		override protected function initBBDC():void
		{
			bbdc = AnimationManager.getAnimation("Monster203Action");
			bbdc.setAction("idle");
			bbdc.turnRight();
			bbdc.addCallBack(onEnterFrame, onActionOver);
			bodyContainer.addChild(bbdc);
		}
		
		override protected function initCollideArea():void
		{
			collideBox = new Rectangle(-25,-82,50,82);
			super.initCollideArea();
		}
		
		override protected function initAttribute():void
		{
			super.initAttribute();
			mavo.attackRange = 150;
		}
		
		override protected function onEnterFrame(action:String, frameCount:int):void
		{
			switch (action)
			{
				case "attack1":
					if(frameCount == 1)
					{
						var b:RegionBullet = new RegionBullet();
						b.setOwner(this);
						b.setHurt(getActionHurt("attack1"));
						b.setCollideArea(0,-114,150 * bbdc.getDirect(),114);
						b.setAction("Monster203Attack1");
						b.setDestroyInCount(bbdc.frameLeft);
						gc.gameScene.addChild(b);
						magicBulletArray.push(b);
					}
					break;
				case "skill1":
					if(frameCount == 3)
					{
						var bu:EnemyMoveBullet = new EnemyMoveBullet("Monster203Skill1");
						bu.setOwner(this);
						bu.flipClip();
						bu.setCollideArea(-25,-7,50,14);
						bu.setPosition(getCollideCenter().x,getCollideCenter().y);
						bu.setHurt(getActionHurt("skill1"));
						bu.setAction("Monster203Skill1");
						bu.setDirect(bbdc.getDirect());
						bu.setDistance(1000);
						bu.setSpeed(10 * bbdc.getDirect(),0);
						bu.setSpeedAdd(3 * bbdc.getDirect(),0);
						FilterUtil.setGlow(bu,0x6633CC,1,15,15);
						FilterUtil.setBlur(bu,3,3);
						FilterUtil.clearCache();
						gc.gameScene.addChild(bu);
						magicBulletArray.push(bu);
					}
			}
		}
		
		override protected function beforeSkill1Start():Boolean
		{
			return hasTarget() && AUtils.GetDisBetweenTwoObj(curAttackTarget,this) < 350;
		}
	}
}